// 水压的数据的状态鸡
import { defineStore } from 'pinia';
import { chartGet, addressGet } from '../api/running';
export const useRuning = defineStore('run', {
  state: () => ({
    bool: false,
    runList: [],
    timeList: [],
    regionList: ['水压'],
    citys: []
  }),
  actions: {
    // 获取图表所需数据
    async runAllAction(key: string) {
      // this.timeList = this.datasd.updateTimes
      this.bool = false
      let res = await chartGet(key);
      this.bool = true
      this.runList = res.data.results[0].pressure
      this.timeList = res.data.results[0].updateTimes
      console.log(this.runList);

    },
    // 获取地区所需数据
    async addressInfo() {
      let res = await addressGet()
      this.citys = res.data.results
    }
  }
})  